/*
 *  Class name: SGAClientMainFrame.java
 *  Version: 1.0
 *  Date: 7.12.2013
 */
package cz.muni.fi.pa165.soccergamesarchive.restclient.gui;

import cz.muni.fi.pa165.soccergamesarchive.restclient.gui.components.ClockMenu;
import java.awt.Color;
import javax.swing.Box;
import javax.swing.ImageIcon;

/**
 *
 * @author Michal Ďuriš
 */
public class SGAClientMainFrame extends javax.swing.JFrame {

    public static final Color NORMAL_STATE_COLOR = new Color(0, 0, 0);
    public static final Color ERROR_STATE_COLOR = new Color(250, 0, 0);

    private static final long serialVersionUID = 1L;

    /**
     * Creates new form SGAClientMainFrame
     */
    public SGAClientMainFrame() {
        initComponents();

        setLocationRelativeTo(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainSeparator = new javax.swing.JSeparator();
        editableTeamList = new cz.muni.fi.pa165.soccergamesarchive.restclient.gui.components.pageablelist.entity.EditableTeamList(this, "Teams");
        menu = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        exitMenuItem = new javax.swing.JMenuItem();
        clockMenu = new ClockMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Soccer games archive client");
        setIconImage(new ImageIcon(getClass().getResource("/icons/soccer-icon.png")).getImage());
        setMinimumSize(new java.awt.Dimension(180, 320));
        setPreferredSize(new java.awt.Dimension(250, 350));
        getContentPane().add(mainSeparator, java.awt.BorderLayout.PAGE_START);

        editableTeamList.init();
        getContentPane().add(editableTeamList, java.awt.BorderLayout.CENTER);

        fileMenu.setForeground(new java.awt.Color(0, 102, 255));
        fileMenu.setText("File");

        exitMenuItem.setForeground(new java.awt.Color(0, 102, 255));
        exitMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/menu/app-shutdown-icon.png"))); // NOI18N
        exitMenuItem.setText("Exit");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menu.add(fileMenu);

        menu.add(Box.createHorizontalGlue());

        menu.add(clockMenu);

        setJMenuBar(menu);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info
                    : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException |
                 IllegalAccessException |
                 javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(
                    SGAClientMainFrame.class.getName()).log(
                            java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(() -> {
            new SGAClientMainFrame().setVisible(true);
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu clockMenu;
    private cz.muni.fi.pa165.soccergamesarchive.restclient.gui.components.pageablelist.entity.EditableTeamList editableTeamList;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JSeparator mainSeparator;
    private javax.swing.JMenuBar menu;
    // End of variables declaration//GEN-END:variables
}
